<%@ page contentType="text/html; charset=UTF-8" session="false"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@page import="net.sf.ehcache.CacheManager"%>
<%@page import="net.sf.ehcache.Cache"%>
<%@page import="net.sf.ehcache.Statistics"%><html>
<head>
<title>系统监控</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
BODY {
	font-size: 14px
}

td {
	font-size: 14px;
	height: 30px;
}

.title {
	color: darkblue;
	font-size: 16px;
	font-weight: bold;
}

.tableHead TD {
	white-space: nowrap;
	border: 1px solid #A0A0A0
}
</style>
</head>
<body topmargin="2">
<center>
<div style="width: 800px; text-align: left; border: solid 1 #f0f0f0">
<hr />
<br />
<span class="title">当前数据缓存情况</span>:
</center>
<table style="background-color: #8040A0;">
	<tr>
		<td style="background-color: #FFFFFF">name</td>
		<td style="background-color: #FFFFFF">DiskStoreHitCount</td>
		<td style="background-color: #FFFFFF">DiskStoreSize</td>
		<td style="background-color: #FFFFFF">MemoryStoreHitCount</td>
		<td style="background-color: #FFFFFF">MemoryStoreSize</td>
		<td style="background-color: #FFFFFF">TimeToLiveSeconds</td>
		<td style="background-color: #FFFFFF">TimeToIdleSeconds</td>
	</tr>
	<%
		String[] names = CacheManager.getInstance().getCacheNames();
		for (int i = 0; i < names.length; i++) {
			Cache c = CacheManager.getInstance().getCache(names[i]);
			Statistics stat = c.getStatistics();
	%>
	<tr>
		<td width="200px" style="text-align: left; background-color: #FFFFFF"><b><%=c.getName()%></b></td>
		<td width="40px;" style="background-color: #FFFFFF"><%=c.getSize()%></td>
		<td width="60px;" style="background-color: #FFFFFF"><%=c.getMemoryStoreSize()%></td>
		<td width="60px;" style="background-color: #FFFFFF"><%=c.getDiskStoreSize()%></td>
		<td width="60px;" style="background-color: #FFFFFF"><%=stat.getCacheHits()%></td>
		<td width="60px;" style="background-color: #FFFFFF"><%=stat.getInMemoryHits()%></td>
		<td width="60px;" style="background-color: #FFFFFF"><%=stat.getOnDiskHits()%></td>
	</tr>
	<%
		}
	%>
</table>
</div>
</center>
</body>
</html>
